package com.mayuanfei.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * TODO 类描述
 *
 * @author 老马
 * @date 2023-04-03 16:19
 */
public class MyFilter1 implements Filter {


    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("MyFilter1初始化方法");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("MyFilter1,客户端请求被拦截了");
        chain.doFilter(request, response);
        System.out.println("MyFilter1,返回客户端的信息被拦截了");
    }

    @Override
    public void destroy() {
        System.out.println("MyFilter1销毁方法");
    }
}